<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Login Page</title>
    </h:head>
    <h:body>
          <h:form>
             <p:messages id="messages" showDetail="true" 
                         autoUpdate="true" 
                         closable="true" />
            <h:panelGrid columns="1" cellpadding="5" style="text-align: left">
                <p:outputLabel value="#{bundle.ask_have_account}"/>
                <h:panelGrid columns="3" cellpadding="5">
                    <p:outputLabel for ="loginField" value="#{bundle.login}" />
                    <p:inputText id ="loginField" 
                             value ="#{loginPageController.login}">
                        <f:validateLength minimum="3" maximum="30"/>
                    </p:inputText>
                    <p:message for="loginField" display="text" />
           
                    <p:outputLabel for ="passwordField" 
                                   value="#{bundle.password}" />
                    <p:password id ="passwordField" 
                             value ="#{loginPageController.password}">
                        <f:validateLength minimum="6" maximum="30"/>
                    </p:password>
                    <p:message for="passwordField"/>
                </h:panelGrid>
            </h:panelGrid>
             
              <h:panelGrid columns="1" cellpadding="5" style="text-align: left">
                <p:commandButton id="loginButton" 
                                 value="#{bundle.login_button}"
                                 action="#{loginPageController.loginUser()}"/>
               
                <p:outputLabel value="#{bundle.no_have_account}"/>
              </h:panelGrid>        

          </h:form>
          <h:form>
               <h:panelGrid columns="1" cellpadding="5" style="text-align: left">
                <p:commandButton id="regButtonLogin"  
                                 value="#{bundle.registration_button}"
                                 action="#{loginPageController.register()}" />
               </h:panelGrid>      
          </h:form>
    </h:body>
</html>

